package admin

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/admin/system"
)

func (c *ControllerSystem) AdminUpdateUser(ctx context.Context, req *system.AdminUpdateUserReq) (res *system.AdminUpdateUserRes, err error) {
	res = new(system.AdminUpdateUserRes)
	err = service.SystemUser().UpdateUserById(ctx, req.Id, model.SystemUserUpdateInput{
		Name:   req.Name,
		Avatar: req.Avatar,
		Phone:  req.Phone,
	})
	return
}
